@extends('admin.layout.common')
@section('content')
    <link rel="stylesheet" type="text/css" href="{{URL::asset('css/app.css')}}">
    <link rel="stylesheet" type="text/css" href="{{URL::asset('css/music/AddCompany.css')}}">
    <style>
        .box .left {
            width: 99%;
        }
        .commonality .left .right .content h1{
            width:260px;
        }
        .commonality .left .right .content {
            width: 80%;
            text-align: left;
            margin-left: 46px;
            font-size: 16px;
            color: #333;
        }
        .form_box{
            margin:30px 0;
        }
        input[type=date]{
            width:140px;
        }
        input{
            width:230px;
            height:50px;
        }
        select{
            width:304px;
            height:50px;
            margin:10px;
        }
        p:last-child{

        }
        button{
            border:none;
            color:#fff;
            background:#CF2121;
            width:140px;
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            border-radius: 5px;
            cursor:pointer;
        }
    </style>
    <div class="content">
        <h1 class="h1">音乐作品特殊授权</h1>
        <form action="{{url('admin/special')}}" method="post" enctype="multipart/form-data">
            {{csrf_field()}}
            <div class="form_box">
                <p>
                    <label for="">选择授权公司：
                        <select name="bussiness_id" required>
                            <option value="">--请选择--</option>
                            @foreach($buss as $v)
                                <option value="{{$v['id']}}">{{$v['company_name']}}</option>
                            @endforeach
                        </select>
                    </label>
                    <label for="">选择授权文件：</label>
                    <input type="file" class="upload_file" name="files_name" onchange="doChange(this)" style="display:none;"/>
                    <input class="photoCover" type="text" style="" required>
                    <input type="button" onclick="$('input[class=upload_file]').click();" class="mybutton" value="浏览" style="border:none;color:#fff;background:#CF2121;width:80px;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;cursor:pointer;"/>
                    <label for="">授权时间：
                        <input type="date" required name="start_time">----
                        <input type="date" required name="end_time">
                    </label>
                </p>
                <p>
                    <label for="">合作简述：
                        <textarea name="mark" id="" cols="30" rows="10" style="vertical-align:top;margin-top:30px;width:750px;height:125px;" required></textarea>
                    </label>
                </p>
            </div>
            <table border="1">
                <tr>
                    <th>授权ID</th>
                    <th>作品名</th>
                    <th>专辑名</th>
                    <th>演唱人</th>
                </tr>
                @foreach($info as $v)
                <tr>
                    <td>{{$v['id']}}</td>
                    <td>{{$v['title']}}</td>
                    <td>{{$v['album']}}</td>
                    <td>{{$v['performer']}}</td>
                </tr>
               @endforeach
            </table>
            <p style="text-align: center;margin-top:30px;"><button type="submit" class="submit">确认添加授权</button></p>
        </form>
    </div>
<script>
    //预览功能
    function doChange(file){
        var upload_file = $.trim($(".upload_file").val());    //获取上传文件
        $('.photoCover').val(upload_file);     //赋值给自定义input框
    }
</script>
@endsection
